<?php
$db=new PDO('mysql:host=localhost;dbname=chengyu','root','12qwas');
$r=$db->query("select cy as 成语, first 首字 from chengyu limit 2");
foreach ($r as $row){
    print_r($row);
}